#!/bin/bash
IFS='\n'
TODAY=`date +%Y%m%d`
if [ ! -f /data/www/EBAK/jobpush/.frgbaktaget ]; then
if [ `find /data/www/EBAK/jobpush/newtask | wc -l` -gt 1 ]; then
file=`ls /data/www/EBAK/jobpush/newtask|sort |head -1`
mv /data/www/EBAK/jobpush/newtask/$file /data/www/EBAK/jobpush/donetask/$file
if [ -f /data/www/EBAK/jobpush/donetask/$file ]; then
uniq /data/www/EBAK/jobpush/donetask/$file > /data/www/EBAK/jobpush/.frgbaktaget
for line in `cat /data/www/EBAK/jobpush/.frgbaktaget`
do
/usr/bin/ssh -i /data/www/EBAK/jobpush/key support@`echo $line|awk -F: '{print $2}'` -p `echo $line|awk -F: '{print $3}'` -o StrictHostKeyChecking=no -o ServerAliveInterval=30 -o ServerAliveCountMax=3 "nohup /data/dv_mon/scripts/mysqlbk_man `echo $line|awk -F: '{print $4}'`> /dev/null 2>&1 &" >> /data/www/EBAK/jobpush/log
done
rm -f /data/www/EBAK/jobpush/.frgbaktaget
fi
else
exit 0
fi
else
exit 255
fi
